﻿using ITXHWEB.Models;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Web.Mvc;
using WPFExcelReport;
using WPFExcelReport.Helpers;
using ITXHWEB.Infrastructure;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace ITXHWEB.Controllers
{
    public partial class WBBSTController : ITXController
    { 
        [ChildActionOnly]
        public ActionResult PRWB06WX(string returnUrl)
        {
            ModelState.Clear();
            ViewBag.ReturnUrl = returnUrl;
            MWB.SLO = "01";
            MWB.SLB = "ZZ";
            MWB.LO = "01";
            MWB.LB = "XB";
            MWB.LP = "01      ";
            MWB.WHP = "01XB01      ";
            if (!MWB.IsWHReady)
            {
                INFO = "请扫描目的仓库";
            }
            return PartialView(MWB);
        }
        [HttpPost]
        [AllowAnonymous]
        [ValidateAntiForgeryToken]
        public ActionResult PRWB06WX(WBBSTModel model, string returnUrl)
        {
            try
            {
                MOVEZZ2XB(model);//移库操做  
                if (MWB.IsDataValid)
                {
                    ReStartWX();
                } 
            }
            catch (Exception ex)
            {
                //ModelState.AddModelError("",ex.Message);
                Tracer.Error(ex.StackTrace, ex);
            }


            return RedirectToAction(MAPP, MAPP);
        }
        public void ReStartWX()
        { 
            INFO = "请扫描新生产单:";
        } 
    }
}
